<?php

App::uses('AppModel', 'Model');


class City extends AppModel {

        public $actsAs = array(
            'Search.Searchable',
            );
        public $filterArgs = array(
            'chooser' => array('type' => null),
            'name' => array('type' => 'like', 'field' => array('City.name', 'City.alias')),
            //'country_id' => array('type' => 'value'),
        );
        public $validate = array(
            'name' => array(
                'rule' => array('minLength', 1),
                'message' => 'Name cannot be empty.',
            ),
            'alias' => array(
                'isUnique' => array(
                    'rule' => 'isUnique',
                    'message' => 'This alias has already been taken.',
                ),
                'minLength' => array(
                    'rule' => array('minLength', 1),
                    'message' => 'Alias cannot be empty.',
                ),
            ),
        );
         public $hasMany = array(
            'User' => array(
                'className' => 'User',
                'foreignKey' => 'city_id',
                'dependent' => true,
                'conditions' => '',
                'fields' => '',
                'order' => 'User.id ASC',
                'limit' => '',
                'offset' => '',
                'exclusive' => '',
                'finderQuery' => '',
                'counterQuery' => '',
            ),
        );

        
       

        
        
}

?>